package com.chagee.store.operation.server.controller;

import com.alibaba.fastjson.JSON;
import com.chagee.base.utils.HttpResponse;
import com.chagee.base.utils.HttpResponseUtil;
import com.chagee.store.operation.server.facade.StoreDetailFacade;
import com.chagee.store.operation.server.model.param.StoreDetailParam;
import com.chagee.store.operation.server.model.vo.StoreDetailVO;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.secure.utils.AuthUtil;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * 门店信息
 * @Author : hk
 * @Date : 2025/2/5
 */


@Slf4j
@RestController
@RequestMapping("/store")
public class StoreController {

	@Resource
	private StoreDetailFacade storeDetailFacade;

	@PostMapping("/storeDetail")
	@ApiOperation("门店详情")
	public HttpResponse<StoreDetailVO> queryStoreDetail(@RequestBody @Valid StoreDetailParam request) {
		log.info("store_storeDetail_request:{}, auth:{}", JSON.toJSONString(request), JSON.toJSONString(AuthUtil.getUser()));
		StoreDetailVO storeDetailVO = storeDetailFacade.queryStoreDetail(request);
		return HttpResponseUtil.success(storeDetailVO);
	}
}
